﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GestionCompte.Models.ManageCategory;
using EntityAccess;

namespace GestionCompte.Controllers
{
    public class ManageCategoryController : Controller
    {
        //
        // GET: /ManageCategory/
#region Entry Point
        public ActionResult Enter()
        {
            return View();
        }
#endregion

#region Add
        public ActionResult partialAdd()
        {
            return View("_AddCategory", new GestionCompte.Models.ManageCategory.AddCategory());
        }

        [HttpPost]
        public ActionResult ActionAdd(AddCategory addCategory)
        {
            addCategory.AddToDb();
            return View("_AddCategory", addCategory);
        }
#endregion

#region Modify
        public ActionResult partialModify()
        {
            return View("_ModifyCategory", new GestionCompte.Models.ManageCategory.ModifyCategory());
        }

        public ActionResult ActionModify()
        {
            return View("_ModifyCategory", new GestionCompte.Models.ManageCategory.ModifyCategory());
        }

#endregion 

#region Delete
        public ActionResult partialDelete()
        {
            return View("_DeleteCategory");
        }

        //[HttpPost]
        //public ActionResult partialDelete()
        //{
        //    return View("_DeleteCategory");
        //}
#endregion
    }
}
